package com.jnu.hc.jnuhcusercms.mapper;

import com.jnu.hc.jnuhcusercms.domain.Cireport;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CireportMapper {
    int deleteByPrimaryKey(Integer cirId);

    int insert(Cireport record);

    int insertSelective(Cireport record);

    @Select("select cirId,ciId,ciName,orderId from cireport where orderId=#{orderId}")
    List<Cireport> selectByOrderId(Integer orderId);

    @Select("SELECT c.ciId,s.smId,c.ciName\n" +
            "FROM setmeal s,setmealdetailed sd,checkitem c\n" +
            "WHERE s.smId=sd.smId AND sd.ciId=c.ciId AND s.smId=#{smId}")
    List<Cireport> selectBySmId(Integer smId);

    Cireport selectByPrimaryKey(Integer cirId);

    int updateByPrimaryKeySelective(Cireport record);

    int updateByPrimaryKey(Cireport record);

    @Select("select count(*) from cireport where orderId=#{orderId}")
    public int getCiReportByOrderId(Integer orderId);

    public int saveCiReport(List<Cireport> list);

    @Select("select * from cireport where orderId=#{orderId}")
    public List<Cireport> listCiReport(Integer orderId);

}